package ysq.xyg.host.model.po;

import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 房产模块-报备实体类
 *
 * @author shengQiang yu
 * @date 2019-7-1 15:25:15
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_host_report")
public class HostReport implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	
	/**
     * 楼盘id
     */ 
	@Column(name = "item_id")
	private String itemId;
	
	/**
     * 会员id
     */ 
	@Column(name = "member_id")
	private String memberId;
	
	/**
     * 客户姓名
     */
	@Excel(name = "客户姓名",orderNum = "2")
	@Column(name = "name")
	private String name;
	
	/**
     * 性别
     */
	@Excel(name = "性别",orderNum = "3", replace = { "男_1", "女_2"})
	@Column(name = "sex")
	private String sex;
	
	/**
     * 客户电话
     */
	@Excel(name = "客户电话",orderNum = "4")
	@Column(name = "phone")
	private String phone;
	
	/**
     * 预计到访时间
     */
	@Excel(name = "预计到访时间", format = "yyyy-MM-dd HH:mm:ss",orderNum = "5")
	@Column(name = "use_time")
	private Date useTime;
	
	/**
	 * 报备状态
	 * 1、报备成功，2、客户到访，3、认筹确认，4、无效客户
     */
	@Excel(name = "报备状态",orderNum = "6", replace = { "报备成功_1", "客户到访_2", "认购成功_3", "无效客户_4"})
	@Column(name = "report_state")
	private String reportState;
	
	/**
     * 客户留言
     */
	@Excel(name = "客户留言",orderNum = "10")
	@Column(name = "remarks")
	private String remarks;

	/**
	 * 总金额
	 */
	@Excel(name = "总金额/元",orderNum = "7")
	@Column(name = "all_money")
	private double allMoney;

	/**
	 * 佣金
	 */
	@Excel(name = "佣金/元",orderNum = "8")
	@Column(name = "fee_money")
	private double feeMoney;

	/**
     * 删除标识：1、正常，2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 创建时间
     */
	@Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;
	
	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	/**
	 * 创建时间
	 */
	@Transient
	private String createTimeStr;

	/**
	 * 预计到访时间
	 */
	@Transient
	private String useTimeStr;

	/**
	 * 小区名称
	 */
	@Excel(name = "ID",orderNum = "1")
	@Transient
	private String itemName;

	/**
	 * 城市id
	 */
	@Transient
	private String cityId;

	/**
	 * 区域id
	 */
	@Transient
	private String areaId;

	/**
	 * 父类推荐人会员id
	 */
	@Transient
	private String parentId;

	/**
	 * 父类推荐人名称
	 */
	@Transient
	private String parentName;

	/**
	 * 会员名称
	 */
	@Transient
	private String memberName;

	/**
	 * 会员头像
	 */
	@Transient
	private String memberHeadImage;

	/**
	 * 置业顾问
	 */
	@Column(name = "set_up_business")
	private String setUpBusiness;

	/**
	 * 补充说明
	 */
	@Column(name = "more_remarks")
	private String moreRemarks;

	/**
	 * 客户来源
	 */
	@Excel(name = "客户来源",orderNum = "9")
	@Column(name = "customer_source")
	private String customerSource;

	/**
	 * 卡号
	 */
	@Excel(name = "推荐人卡号",orderNum = "9")
	@Transient
	private String cardNo;

	@Transient
	private String shopNumber;

	@Transient
	private String shopName;

	public HostReport(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}

}